// api.js
let version = [];

function fetchVersion() {
  return uni.request({
    url: 'https://d-yuanding.bigchun.com/api/xilumarket/user/videoList',
    method: 'POST',
    success: (res) => {
      version = res.data.data.data;
	  console.log(version ,'videoData====');
	  uni.setStorageSync('videoData', version)
    }
  });
}

// 立即执行请求
fetchVersion();

// 导出version的引用，但是注意：由于异步，刚开始是空数组
export default {
  version,
  fetchVersion
};